package com.lh.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * 监听器类
 * 注解@WebListener：申明此类会监听器配置类
 * 配合@ServletComponentScan使用
 *
 * @Author LuoHang
 * @Date 2022-05-10 18:20
 **/
@WebListener
public class MyListener01 implements ServletContextListener {
    public static final Logger logger = LoggerFactory.getLogger(MyListener01.class);
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        logger.info("MyListener01.contextInitialized()方法执行........");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        logger.info("MyListener01.contextDestroyed()方法执行........");
    }
}
